import tui from '../../../common/httpRequest'
Page({
  data: {
    actions: [{
        name: '删除',
        color: '#fff',
        fontsize: 30, //单位rpx
        width: 70, //单位px
        background: '#FD3B31'
      },
      {
        name: '修改',
        color: '#fff',
        fontsize: 30,
        width: 70,
        background: '#5677fc'
      },
      {
        name: '收藏',
        width: 70,
        fontsize: 30,
        color: '#fff',
        background: '#C8C7CD'
      }
    ],
    actions2: [{
        name: '普通',
        color: '#fff',
        fontsize: 30,
        width: 70,
        background: '#C8C7CD'
      },
      {
        name: '警示',
        color: '#fff',
        fontsize: 30, //单位rpx
        width: 70, //单位px
        background: '#FD3B31'
      }
    ],
    open: false
  },
  handlerButton(e) {
    let index = e.detail.index;
    let item = e.detail.item;
    let menuTxt = ['删除', '修改', '收藏'][index];
    tui.toast('您点击了【' + menuTxt + '】按钮');
  },
  handlerButton2(e) {
    let index = e.detail.index + 1;
    tui.toast('您点击了按钮' + index);
  },
  customBtn(e) {
    let index = Number(e.currentTarget.dataset.index);
    index = index + 1;
    tui.toast('您点击了按钮' + index);
  },
  switchChange: function(e) {
    this.setData({
      open:e.detail.value
    })
  }

})